<?
	require_once('init.php');
	require_once('dataModel.php');

	$_SESSION["MenuID"]='';

	$strSQL= "select U.id,U.userName,U.effectNum,";  
	$strSQL.="       R.shopRoomID,R.roomName,R.effectDate,";
	$strSQL.="       (CASE R.useType WHEN '1' THEN '付费用户' ELSE '试用用户' END) AS useType, ";  
	$strSQL.="       (CASE R.serverType WHEN '1' THEN '独立服务类型' ELSE '公共服务类型' END) AS serverType ";  
	$strSQL.="from userInfo U LEFT JOIN roomBaseInfo R ON R.userID=U.id ";  
	$strSQL.="where U.userName='".$_SESSION["userName"]."' limit 0,1 "; 

	$db = MySQL::getInstance('','r-w'); 
	$DBR=$db->query($strSQL); 
  	$result=$db->fetch($DBR);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<?='utf-8';?>" />
	<title><?=$AllPageTitle;?></title>
	<link href="css/CenterMenu.css" rel="stylesheet" type="text/css" />
	
	
	<? include("alljs.php"); ?>
	
	<script language="javascript">
   		function CheckData()
   		{
			var strSQL = "";                      
			strSQL+= "roomName=";
			strSQL+=$("#roomname").attr("value");
			strSQL+= "&Type=edituserdata";
			
//			alert (strSQL);
			
			$.post("varifyData.php",strSQL,function(msg)
			{

//			    alert (msg);
			    
			   	if (msg=='1')
			   	{	
					parent.hiAlert("个人资料修改成功!", '系统提示');
					$("#email").focus();
					return false;
			   	}
			})
	    }    
	</script>
</head>


<body>
	<div id="MenuRighttitle" ><div style="padding-left:245px;padding-top:5px;"><b><?="账户信息";?></b></div></div>
	
	<div class="inner-container">
		<div class="bodypart" style="border:0px solid blue;">	
			<div style="padding-left: 120px; margin-top: 20px; text-align: left; min-height: 300px;border:0px solid blue;">
				<div class="userpwd-a04"><b><?="会员ID:";?></b></div>
				<div class="userdata_a02"><b><?=$_SESSION["UID"];?></b></div>
				<div class="userdata_a01"></div>

				<div class="userpwd-a04" ><b><?="账号:";?></b></div>
				<div class="userdata_a02" ><b><?=$_SESSION["userName"];?></b></div>
				<div class="userdata_a01"></div>

				<div class="userpwd-a04" ><b><?="使用类型:";?></b></div>
				<div class="userdata_a02" ><b><?=$result["useType"];?></b></div>
				<div class="userdata_a01"></div>

				<div class="userpwd-a04" ><b><?="有效日期:";?></b></div>
				<div class="userdata_a02" ><b><?=date("Y-m-d",strtotime($result["effectDate"]));?></b></div>
				<div class="userdata_a01"></div>

				<div class="userpwd-a04" ><b><?="客服数量:";?></b></div>
				<div class="userdata_a02" ><b><?=$result["effectNum"]."人";?></b></div>
				<div class="userdata_a01"></div>

				<div class="userpwd-a04" ><b><?="服务类型:";?></b></div>
				<div class="userdata_a02" style="width:400px;">
					<b><?=$result["serverType"];?></b>
					<?
					if ($result["serverType"]=='公共服务类型')
					{
					?>
						<span><a href="default.php" style="color:blue;margin-left:60px;font-size:12px;"><b>点击这里升级至独立服务类型</b></a></span>
					<?
					}
					?>	
				</div>
				<div class="userdata_a01"></div>

				<div class="userpwd-a04" ><b><?="聊天室名称:";?></b></div>
				<div class="userdata_a02"><input type="text" id="roomname" name="roomname" value="<?=$result["roomName"];?>" size="30" maxlength="50" class="userinfo_textbox" style="width:220px;" /></div>
				<div class="userdata_a03"><input type="image" name="submitimage" src="<?=$lng_imagepath;?>submit_btn.gif" value="Submitimage" onmouseover="this.src='<?=$lng_imagepath;?>submit_btn-hover.gif'" onmouseout="this.src='<?=$lng_imagepath;?>submit_btn.gif'" onclick="javascript:CheckData();" /></div>

				<div class="userdata_a01"></div>
				
			</div>
		</div>
	</div>
</body>

</html>
